package cn.janescott.ribboncustom.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author scott
 * @date 2019/1/3
 */
@RestController
@RequestMapping("/query")
public class QueryController {

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/getServiceUrl")
    public Object getServiceUrl() {
        return restTemplate.getForObject("http://EUREKA-CLIENT/query/getEurekaServerUrl", String.class);
    }

    @GetMapping("/getClientUrl")
    public Object getClientUrl() {
        return restTemplate.getForObject("http://EUREKA-CLIENT/query/getEurekaInfo", String.class);
    }


}
